package model.registro;



public class RegistroHoja implements Comparable<RegistroHoja>, Cloneable{
	private String term;
	private Integer offset;
	private Float pesoGlobal;
	private int cantCaractNuevos;
	private int cantCaractRepetidos;
	
	
	public RegistroHoja(){
		
	}
	public String getTermino() {
		return term;
	}
	public void setTerm(String term) {
		this.term = term;
	}
	public int getOffset() {
		return offset;
	}
	public void setOffset(int offset) {
		this.offset = offset;
	}
	
	
	public boolean equals(RegistroHoja o){
		if ((this.cantCaractNuevos==o.getCantCaractNuevos()) &&
				(this.cantCaractRepetidos== o.getCantCaractRepetidos()) &&
				(this.offset==o.getOffset())&&
				(this.pesoGlobal.equals(o.getPesoGlobal()))&&
				(this.term.equals(o.getTermino())))
				return true;
			else return false;
	}
	
	public int compareTo(RegistroHoja o) {
		return this.getTermino().compareTo(o.getTermino());
	}
	
	
	@Override
    public Object clone(){
		RegistroHoja obj=null;
        try{
            obj=(RegistroHoja)super.clone();
        }catch(CloneNotSupportedException ex){
            System.out.println(" no se puede duplicar");
        }
        obj.term = new String(this.term);
        obj.offset = new Integer(this.offset);
        obj.pesoGlobal = new Float(this.pesoGlobal);
        obj.cantCaractNuevos = new Integer(this.cantCaractNuevos);
        obj.cantCaractRepetidos =new Integer(this.cantCaractRepetidos);
        return obj;
    }
	public int getCantCaractNuevos() {
		return cantCaractNuevos;
	}
	public void setCantCaractNuevos(int cantCaractNuevos) {
		this.cantCaractNuevos = cantCaractNuevos;
	}
	public int getCantCaractRepetidos() {
		return cantCaractRepetidos;
	}
	public void setCantCaractRepetidos(int cantCaractRepetidos) {
		this.cantCaractRepetidos = cantCaractRepetidos;
	}
	public Float getPesoGlobal() {
		return pesoGlobal;
	}
	
	public void setPesoGlobal(float pesoGlobal) {
		this.pesoGlobal =  pesoGlobal;
	}
	
	public int getTamanioTermino(){
		return this.term.length();
	}
}
